package com.neusoft.elm.view.impl;

import java.util.Scanner;
import com.neusoft.elm.dao.AdminDao;
import com.neusoft.elm.dao.Impl.AdminDaoImpl;
import com.neusoft.elm.po.Admin;
import com.neusoft.elm.view.AdminView;

/**
 * 管理员方法实现
 * view层
 */
public class AdminViewImpl implements AdminView{

    private Scanner input = new Scanner(System.in);

    /**
     * 管理员登录
     * @return
     */
    @Override
    public Admin login() {
        System.out.println("请输入管理员名称：");
        String adminName = input.next();
        System.out.println("请输入密码：");
        String password = input.next();

        AdminDao dao = new AdminDaoImpl();
        return dao.getAdminByNameByPass(adminName, password);
    }
}
